# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DataCatalog.V1beta1.Model.GoogleCloudDatacatalogV1beta1TagField do
  @moduledoc """
  Contains the value and supporting information for a field within a Tag.

  ## Attributes

  *   `boolValue` (*type:* `boolean()`, *default:* `nil`) - Holds the value for a tag field with boolean type.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Output only. The display name of this field.
  *   `doubleValue` (*type:* `float()`, *default:* `nil`) - Holds the value for a tag field with double type.
  *   `enumValue` (*type:* `GoogleApi.DataCatalog.V1beta1.Model.GoogleCloudDatacatalogV1beta1TagFieldEnumValue.t`, *default:* `nil`) - Holds the value for a tag field with enum type. This value must be one of the allowed values in the definition of this enum.
  *   `order` (*type:* `integer()`, *default:* `nil`) - Output only. The order of this field with respect to other fields in this tag. It can be set in Tag. For example, a higher value can indicate a more important field. The value can be negative. Multiple fields can have the same order, and field orders within a tag do not have to be sequential.
  *   `stringValue` (*type:* `String.t`, *default:* `nil`) - Holds the value for a tag field with string type.
  *   `timestampValue` (*type:* `DateTime.t`, *default:* `nil`) - Holds the value for a tag field with timestamp type.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :boolValue => boolean() | nil,
          :displayName => String.t() | nil,
          :doubleValue => float() | nil,
          :enumValue =>
            GoogleApi.DataCatalog.V1beta1.Model.GoogleCloudDatacatalogV1beta1TagFieldEnumValue.t()
            | nil,
          :order => integer() | nil,
          :stringValue => String.t() | nil,
          :timestampValue => DateTime.t() | nil
        }

  field(:boolValue)
  field(:displayName)
  field(:doubleValue)

  field(:enumValue,
    as: GoogleApi.DataCatalog.V1beta1.Model.GoogleCloudDatacatalogV1beta1TagFieldEnumValue
  )

  field(:order)
  field(:stringValue)
  field(:timestampValue, as: DateTime)
end

defimpl Poison.Decoder,
  for: GoogleApi.DataCatalog.V1beta1.Model.GoogleCloudDatacatalogV1beta1TagField do
  def decode(value, options) do
    GoogleApi.DataCatalog.V1beta1.Model.GoogleCloudDatacatalogV1beta1TagField.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.DataCatalog.V1beta1.Model.GoogleCloudDatacatalogV1beta1TagField do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
